package com.wiscamp.ninechapters.problems.infrastructure.po.sheets;

import com.wiscamp.ninechapters.ddd.PersistenceObject;
import jakarta.persistence.*;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serial;

/**
 * 答题卡明细文本扩展  多项文本答题卡扩展
 */
@Entity
@Table(name = "sheet_answers")
@Data
@Accessors(chain = true)
public class SheetAnswerPO implements PersistenceObject {

    @Serial
    private static final long serialVersionUID = 308200140021466675L;

    /**
     * 自动编号
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", nullable = false)
    private long id = 0;

    /**
     * 答题卡明细编号
     */
    @Column(name = "sheet_detail_id", nullable = false)
    private long sheetDetailId = 0;

    /**
     * 序号
     */
    @Column(name = "answer_index", nullable = false)
    private int answerIndex = 0;


    /**
     * 用户选项答案文本内容（记录用户选择选择选项编号，逗号间隔）
     */
    @Column(name = "option_content_text")
    private String optionContentText = "";

    /**
     * 用户答案文本（选项答案记录ABCD，选项间隔）
     */
    @Column(name = "content_text", nullable = false)
    private String contentText;

    /**
     * 分组序号
     */
    @Column(name = "answer_group_index", nullable = false)
    private int answerGroupIndex = 0;

    /**
     * 是否忽略答题
     */
    @Column(name = "skipped", nullable = false)
    private boolean skipped = false;

    /**
     * 是否正确
     */
    @Column(name = "correct", nullable = false)
    private boolean correct = false;

    /**
     * 正确答案编号
     */
    @Column(name = "correct_answer_id", nullable = false)
    private long correctAnswerId = 0;

    /**
     * 正确答案类型编号
     */
    @Column(name = "correct_answer_type_id", nullable = false)
    private int correctAnswerTypeId = 0;

    /**
     * 问题单个答案获得分数
     */
    @Column(name = "gain_score", nullable = false)
    private double gainScore = 0;

    /**
     * 用户答案内容类型编号
     */
    @Column(name = "content_type_id", nullable = false)
    private int contentTypeId = 0;
}
